package designpattern.d16;

import java.util.ArrayList;
import java.util.List;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author songx
 * @date 2020/2/20 14:41
 */
public class Alert {

    private List<AlertHandler> alertHandlers = new ArrayList<>();

    public void addAlertHandler(AlertHandler alertHandler) {
        this.alertHandlers.add(alertHandler);
    }

    public void check(ApiStatInfo apiStatInfo) {
        for (AlertHandler handler : alertHandlers) {
            handler.check(apiStatInfo);
        }
    }
}